<template>
  <n-grid cols="24" item-responsive responsive="screen">
    <n-grid-item span="24 s:12 m:8" offset="0 s:6 m:8">
      <n-form ref="formRef" :label-width="80" label-placement="left" style="margin-top: 50px">
        <n-form-item label="银行名称:">
          <n-input v-model:value="bank.bankName"/>
        </n-form-item>
        <n-form-item label="操作">
          <n-button type="info" ghost block @click="addBank">
            确认添加
          </n-button>
        </n-form-item>
      </n-form>
    </n-grid-item>
  </n-grid>
</template>

<script>
export default {
  name: "AddOfBankTemplate",
  data(){
    return{
      bank:{
        bankName:''
      }
    }
  },
  methods:{
    addBank:function (){
      this.axios.post("/bank/addBank",this.bank).then((res)=>{
        const data=res.data;
        let msg;
        if (data.code>0){
          msg=data.error;
        }else {
          msg=data.data;
        }
        if (this.$utils.tipsOption(data.code, data.status, msg)) {
          return;
        }
        this.$router.push("/index/maintainOfBank")
      })
    }
  }
}
</script>

<style scoped>

</style>